import 'package:flutter/material.dart';

import '../../public.dart';

/// 书单1号(分类页+阅读页历史记录、作者介绍)
class Book1Component extends StatelessWidget {
  final String cover;
  final String title;
  final String desc;
  final Size imgSize;
  Book1Component(
      {Key key,
      this.cover,
      this.title,
      this.desc,
      this.imgSize = const Size(105, 140)})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        ClipRRect(
            borderRadius: BorderRadius.circular(8),
            child: ImagesNetworkComponent(cover,
                width: imgSize.width, height: imgSize.height)),
        SizedBox(height: 8),
        Expanded(
            child: Container(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                title,
                overflow: TextOverflow.ellipsis,
                style: TextStyle(color: Colors.white, fontSize: 14),
              ),
              SizedBox(height: 2),
              Text(
                desc,
                overflow: TextOverflow.ellipsis,
                style: TextStyle(
                    color: ColorUtil.rgba(255, 255, 255, 0.6), fontSize: 10),
              ),
            ],
          ),
        ))
      ],
    );
  }
}
